<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@include file="/pages/hy/common.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>作业信息(备份)</title>
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/toastr.min.css">
<script src="${pageContext.request.contextPath }/js/toastr.min.js"></script>
<script type="text/javascript">
    toastr.options.positionClass = 'toast-top-center';
 </script>
<%
	String dev = request.getParameter("dev");//设备编号
	String email = request.getParameter("email");//人员
	String email1 = request.getParameter("email1");//人员1
%>
<script type="text/javascript">
$(function () {
	
    //1.初始化Table
    var oTable = new TableInit();
    oTable.Init();
    
    //2.初始化Button的点击事件
    var oButtonInit = new ButtonInit();
    oButtonInit.Init();
});
var TableInit = function () {
    var oTableInit = new Object();
    //初始化Table
    oTableInit.Init = function () {
       
        $('#tb_departments').bootstrapTable({
                   //请求后台的URL（*）
            method: 'post',                      //请求方式（*）
            striped: true,                      //是否显示行间隔色
            cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
            pagination: true,                   //是否显示分页（*）
            sortable: false,                     //是否启用排序
            sortOrder: "asc",                   //排序方式
            queryParams: oTableInit.queryParams,//传递参数（*）
            sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
            pageNumber:1,                       //初始化加载第一页，默认第一页
            pageSize: 10,                       //每页的记录行数（*）
            pageList: [10,20,30],         //可供选择的每页的行数（*）
            clickToSelect: true,                //是否启用点击选中行
            height: 500,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
            uniqueId: "ID",                     //每一行的唯一标识，一般为主键列
            detailView: false,                   //是否显示父子表
            columns: [{
                checkbox: true
            }, {
                field: 'id',
                title: 'ID',
                visible:false
            }, {
                field: 'remark1',
                title: '排产单编号'
            },{
                field: 'pnum',
                title: '品编'
            }, {
                field: 'pname',
                title: '品名',
            },{
                field: 'plannum',
                title: '计划量',
            },{
                field: 'stattime',
                title: '开始时间',
            }]
        });
    }
    
    //得到查询的参数
    oTableInit.queryParams = function (params) {
        var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
            limit: params.limit,   //页面大小
            offset: params.offset,  //页码
            machin : $("#deviceId").val(),
        };
        return temp;
    };
    return oTableInit;
};

var ButtonInit = function () {
    var oInit = new Object();
    var postdata = {};

    oInit.Init = function () {
        //初始化页面上面的按钮事件
    };

    return oInit;
};
</script>
<script type="text/javascript">
//页面实时获取时间
		function getCurDate()
		{
		var d = new Date();
		var week;
		switch (d.getDay()){
		case 1: week="星期一"; break;
		case 2: week="星期二"; break;
		case 3: week="星期三"; break;
		case 4: week="星期四"; break;
		case 5: week="星期五"; break;
		case 6: week="星期六"; break;
		default: week="星期天";
		}
		var years = d.getFullYear();
		var month = add_zero(d.getMonth()+1);
		var days = add_zero(d.getDate());
		var hours = add_zero(d.getHours());
		var minutes = add_zero(d.getMinutes());
		var seconds=add_zero(d.getSeconds());
		var ndate = years+"年"+month+"月"+days+"日 "+hours+":"+minutes+":"+seconds+" "+week;
		var divT=document.getElementById("nowDate");
		divT.innerHTML= ndate;
		}
		function add_zero(temp)
		{
		if(temp<10) return "0"+temp;
		else return temp;
		}
		setInterval("getCurDate()",100);
</script>
<script type="text/javascript">
$(function () {
	var number = null;
	//加载所有的设备编号
	/* $.ajax({
			type:"post",
			url: '${pageContext.request.contextPath }/device/allDevice.do',
			success: function(data){
				
				var list = eval('('+data+')');
				$("#deviceId").append('<option value="0"> -- 请选择 -- </option>' )
				for (var i = 0; i < list.length; i++) {
					if (list[i] != undefined && list[i] != null) {
						$("#deviceId").append('<option value='+list[i].eid+'>' + list[i].name + '</option>' )
					}
				}
			}
		}); */

	//查询车间信息
    $.ajax({
        url:'${pageContext.request.contextPath }/jy/selectCarroom.do',
        type:"POST",
        dataType:'json',
        success:function (result) {
            for (var i = 0; i < result.length; i++) {
                $("#carroom").append("<option value="+result[i].id+">"+result[i].name+"</option>");
            }
        }
    });
	
	//清除弹窗原数据
	$("#myModal2").on("hidden.bs.modal", function() {
	    $(this).removeData("bs.modal");
	});
	
    //不良登记1
    $("#btn").click(function(){
    	
    	$("#addForm")[0].reset();//打开模态框前进行重置
    	
    	var dev = $("#deviceId").val();
    	number = $("#number").text();
    	var email = $("#email").val();
    	
    	if(dev != 0 && number != null && number != ""){
    		$("#btn").attr("data-toggle","modal");
    		$("#btn").attr("data-target","#myModal2");
    		$("#registrar").val(email);
    	}else {
    		toastr.warning("设备编号或品编为空");
    	}
    });
    
    //不良登记2
    $("#btn1").click(function(){
    	
    	$("#addForm")[0].reset();//打开模态框前进行重置
    	
    	var dev = $("#deviceId").val();
    	number = $("#number1").text();
    	var email1 = $("#email1").val();
    	if(dev != 0 && number1 != null && number1 != ""){
    		$("#btn1").attr("data-toggle","modal");
    		$("#btn1").attr("data-target","#myModal2");
    		$("#registrar").val(email1);
    	}else {
    		toastr.warning("设备编号或品编为空");
    	}
        
    });
    
    //点击“作业开始”时查询产品的计划量等
    $("#submitBtn3").click(function(){
    	var nmumr = document.getElementById("number1").innerHTML;
		var name1 = $("#name1").text();
		var name2 = $("#name2").text();
		var deviceId = $("#deviceId option:selected").val();
		if((name1 == "" || name1 == null) && (name2 == "" || name2 == null)){
			toastr.info("请先输入员工代码");
			return false;
		}
		if(deviceId == 0){
			toastr.info("请先选择设备编号");
			return false;
		}
		
		if(nmumr == "" || nmumr == null  || nmumr == undefined) {
	    	$('#submitBtn3').attr("disabled","true");
	    	$('#deviceId').attr("disabled","true");
	    	$("#good").text("0");
	    	$("#nogood").text("0");
			document.getElementById("realNum").innerHTML= 0;
			setInterval("getRealNum()",1000);
			setInterval("createWork()",1000);
		}else {
			//$("#submitBtn3").unbind(); //不可以点击，但是不变色
	    	$('#submitBtn3').attr("disabled","true");
	    	$('#deviceId').attr("disabled","true");
	    	$("#nogood").text("0");
			$("#nogood1").text("0");
			document.getElementById("realNum").innerHTML= 0;
			document.getElementById("realNum1").innerHTML= 0;
			document.getElementById("good").innerHTML= 0;
			document.getElementById("good1").innerHTML= 0;
			setInterval("getRealNum()",1000);
			setInterval("createWork()",1000);
		}
		
	});
    
    //点击“作业结束”按钮时
    $("#submitBtn5").click(function(){
		
		//作业人员
		var woker1 = $("#name1").text();
		var woker2 = $("#name2").text();
		
		if((name1 == "" || name1 == null) && (name2 == "" || name2 == null) || deviceId == 0){
			toastr.info("作业未正常开始");
			return false;
		/* }else if($("#cartype").text() == "" && $("#modelid").text() == ""){
			toastr.info("作业未正常开始");
			return false; */
		}else {
			/* var virNum = $("#virNum").text();
			var virNum1 = $("#virNum1").text();
			var realNum = $("#realNum").text();
			var realNum1 = $("#realNum1").text(); */
			if(parseInt(realNum) > parseInt(virNum) && parseInt(realNum1) > parseInt(virNum1)){
				//暂时不存在这个问题
				/* $("#virNum1").text("");
				$("#realNum1").text("");
				$("#nogood1").text("");
				$("#good1").text("");
				$("#virNum").text("");
				$("#realNum").text("");
				$("#nogood").text("");
				$("#good").text("");
				*/
			}else if(parseInt(virNum) - parseInt(realNum) ==  parseInt(0)) {
				
				//要获取两个排产详情id
				var did = $("#pdid").val(); 
				var remartk2 = $("#pdid1").val(); 
				
				$.ajax({
					type:"post",
					url: '${pageContext.request.contextPath }/allw/closeWork.do',
					data: {pnum:pnum,snum:snum,ngood:ngood,good:good,nmum:nmum,pname:pname
						,pnumr:pnumr,snumr:snumr,ngoodr:ngoodr,goodr:goodr,nmumr:nmumr,pnamer:pnamer
						,woker1:woker1,woker2:woker2,machin:machin,pid:pid,did:did,remartk1:remartk1,remartk2:remartk2},
					success: function(data){
						
						$("#number").text("");
						$("#pname").text("");
						$("#number1").text("");
						$("#pname1").text("");
						$("#virNum1").text("");
						$("#realNum1").text("");
						$("#nogood1").text("");
						$("#good1").text("");
						$("#virNum").text("");
						$("#realNum").text("");
						$("#nogood").text("");
						$("#good").text("");
						$('#submitBtn3').attr("disabled","false"); 
				    	$('#submitBtn5').attr("disabled","true"); 
						toastr.sucsess("生产完成");  
					}
				});
			}else {
				/* toastr.warning("实际量小于计划量，不可以结束"); */
				//要获取两个排产详情id
					//计划量
				 var pnum = document.getElementById("virNum").innerHTML;
				//实际量
				var snum = document.getElementById("realNum").innerHTML;
				//不良品
				var ngood = document.getElementById("nogood").innerHTML;
				//良品
				var good = document.getElementById("good").innerHTML;
				//品编
				var nmum = document.getElementById("number").innerHTML;
				//产品名称
				var pname = document.getElementById("pname").innerHTML;
				 
				var pnumr = document.getElementById("virNum1").innerHTML;
				var snumr = document.getElementById("realNum1").innerHTML;
				var ngoodr = document.getElementById("nogood1").innerHTML;
				var goodr = document.getElementById("good1").innerHTML;
				var nmumr = document.getElementById("number1").innerHTML;
				var pnamer = document.getElementById("pname1").innerHTML;
						
						
				//作业人员
				var woker1 = $("#name1").text();
				var woker2 = $("#name2").text();
				//设备
				var machin = $.trim($("#deviceId").val());
				
				var pid =  $("#pcid").val(); 
				var remartk1 =  $("#pcid1").val(); 
				var did = $("#pdid").val(); 
				var remartk2 = $("#pdid1").val(); 
		
				$.ajax({
					type:"post",
					url: '${pageContext.request.contextPath }/allw/closeWork.do',
					data: {pnum:pnum,snum:snum,ngood:ngood,good:good,nmum:nmum,pname:pname
						,pnumr:pnumr,snumr:snumr,ngoodr:ngoodr,goodr:goodr,nmumr:nmumr,pnamer:pnamer
						,woker1:woker1,woker2:woker2,machin:machin,pid:pid,did:did,remartk1:remartk1,remartk2:remartk2},
					success: function(data){
						window.location.replace("${pageContext.request.contextPath }/pages/jyy/allw.jsp")
						return;
					}
				});
			} 
		}
		
    });
    
    $("#submitBtn4").click(function(){
    	$("#submitBtn4").attr('data-toggle','modal');
    	$("#submitBtn4").attr('data-target','#myModal1');
    	$("#email").val('');
    	$("#email1").val('');
    	
    })
    
    /* 员工代码提交按钮触发事件，将填写的代码带回到页面 （验证此员工代码是否存在）*/
    $("#submit").click(function(){
    	var email = $("#email").val();
		var email1 = $("#email1").val();
    	$.ajax({
			type:"post",
			url:'${pageContext.request.contextPath }/checkNameisExist.do',//在jy/LoginController中
			 data: {name:email,name1:email1},
			success: function(data){
				if(data == 1) {
					if(email == "" || email == null  || email == undefined) {
						$("#name1").text(email1);
					}else if(email == "" || email == null  || email == undefined) {
						$("#name1").text(email);
					}else {
						$("#name1").text(email);
						$("#name2").text(email1);
					}
				}else {
					toastr.info("员工代码不正确，请检查员工代码");
				}
			}
    	});
    	
		/* console.log(email + email1); */
    });
    
    
    //点击不良登记的“保存”按钮
    $("#submitBtn1").click(function(){
    	var dev = $("#deviceId").val();
		var value = func1();
		if(value == null){
			toastr.warning("请先选择不良类型");
		}else {
			$.ajax({
				type:"post",
				url: '${pageContext.request.contextPath }/homeworkInfo/addNoGood.do',
				data: {defectivetype1:value,distinguish: $('#distinguish input[name="distinguish"]:checked ').val(),registrar:$('#registrar').val(),
					badproject:$('#badproject').val(),team:$('#team input[name="team"]:checked ').val(),remartk:dev,remartk1: number},
				success: function(data){
					if(data){
						toastr.success("添加成功");
						if(number == $("#number").text()){
							var nogood = $("#nogood").text();
							$("#nogood").text(parseInt(nogood) + 1);
						}
						if(number == $("#number1").text()){
							var nogood1 = $("#nogood1").text();
							$("#nogood1").text(parseInt(nogood1) + 1);
						}
						
					}else {
						toastr.error("添加失败");
					}
				}
			});
		}
	})
});
</script>
<script type="text/javascript">

/* 填加作业信息 */
function createWork() {
		//计划量
		 var pnum = document.getElementById("virNum").innerHTML;
		//实际量
		var snum = document.getElementById("realNum").innerHTML;
		//不良品
		var ngood = document.getElementById("nogood").innerHTML;
		//良品
		var good = document.getElementById("good").innerHTML;
		//品编
		var nmum = document.getElementById("number").innerHTML;
		//产品名称
		var pname = document.getElementById("pname").innerHTML;
		 
		 var pnumr = document.getElementById("virNum1").innerHTML;
		var snumr = document.getElementById("realNum1").innerHTML;
		var ngoodr = document.getElementById("nogood1").innerHTML;
		var goodr = document.getElementById("good1").innerHTML;
		var nmumr = document.getElementById("number1").innerHTML;
		var pnamer = document.getElementById("pname1").innerHTML;
		
		//作业人员
 		var woker1 = $("#name1").text();
		var woker2 = $("#name2").text();
		//设备
		var machin = $.trim($("#deviceId").val());
		
		var pid =  $("#pcid").val(); 
		var remartk1 =  $("#pcid1").val(); 
		var did = $("#pdid").val(); 
		var remartk2 = $("#pdid1").val(); 
		
		$.ajax({
			type:"post",
			url: '${pageContext.request.contextPath }/allw/createWork.do',
			data: {pnum:pnum,snum:snum,ngood:ngood,good:good,nmum:nmum,pname:pname
				,pnumr:pnumr,snumr:snumr,ngoodr:ngoodr,goodr:goodr,nmumr:nmumr,pnamer:pnamer
				,woker1:woker1,woker2:woker2,machin:machin,pid:pid,did:did,remartk1:remartk1,remartk2:remartk2},
			success: function(data){
				if(data == 1){
				}else {
				}
			}
		});
		
}

/* 打开排产单列表的模态框 */
function pcdxz() {
	
	var equipment = $.trim($("#deviceId").val());
	 if(equipment == "" || equipment == null  || equipment == undefined || equipment == 0 ) {
			toastr.warning("请先选择设备");  
		 return;
	 }else {
		 $("#addForm")[0].reset();//打开模态框前进行重置
			$("#addModal").modal(open);
		 $('#tb_departments').bootstrapTable(  
	             "refresh",  
	             {  
	            		url: '${pageContext.request.contextPath }/jy/selectDysheduDetailByAllw.do?machin='+equipment 
	             }  
	    	  ); 
	 }
}

/* 选择排产单详情后，将数据带回到页面 */
function submitpc() {
	var a= $('#tb_departments').bootstrapTable('getSelections');  
	if(a.length  == 1) {
		//只生产一条
		$("#number").text(a[0].pnum);
		$("#pname").text(a[0].pname);
		$("#virNum").text(a[0].plannum);
		
		//将排产详情和计划详情暂存到页面，保存作业信息时要用
		$("#pcid").val(a[0].remark5); 
		$("#pdid").val(a[0].id); 
		
		$("#addModal").modal('hide');
	}else if(a.length  == 2) {
		//生产两条
		$("#number").text(a[0].pnum);
		$("#pname").text(a[0].pname);
		$("#virNum").text(a[0].plannum);
		
		$("#number1").text(a[1].pnum);
		$("#pname1").text(a[1].pname);
		$("#virNum1").text(a[1].plannum);
		
		//将排产详情和计划详情暂存到页面，保存作业信息时要用
		$("#pcid").val(a[0].remark5); 
		$("#pdid").val(a[0].id); 
		$("#pcid1").val(a[1].remark5); 
		$("#pdid1").val(a[1].id); 
		
		$("#addModal").modal('hide');
	}else if(a.length > 2) {
		toastr.warning("对不起，最多选择两条");  
	}
 
}


//根据选择设备后，在页面填写查询数据
function change(val){
	//先要将数据都清空
	$("#cartype").text("");
	$("#modelid").text("");
	$("#number1").text("");
	$("#pname1").text("");
	$("#virNum1").text("");
	$("#nogood1").text("");
	$("#number").text("");
	$("#pname").text("");
	$("#virNum").text("");
	$("#nogood").text("");
	/* 	$.ajax({
			type:"post",
			url: '${pageContext.request.contextPath }/device/findProByDeviceId.do?id=' + val,
			success: function(data){
				//将查询出的车种以及模具编号显示在页面上
				var list = eval('('+data+')');
				if(list.length > 0){
					$("#cartype").text(list[0].remark);
					$("#modelid").text(list[0].remark1);
					if(list.length > 1){
						$("#number1").text(list[1].num);
						$("#pname1").text(list[1].name);
					}
					$("#number").text(list[0].num);
					$("#pname").text(list[0].name);
				}else {
					$("#cartype").text("");
					$("#modelid").text("");
					$("#number1").text("");
					$("#pname1").text("");
					$("#virNum1").text("");
					$("#nogood1").text("");
					$("#number").text("");
					$("#pname").text("");
					$("#virNum").text("");
					$("#nogood").text("");
					toastr.info("该设备上没有产品");
				}
				
			} 
		});*/
	}
</script>
<script type="text/javascript">
	//作业信息中的实际量是对接北京的接口，需要北京传递值
	var a = 1;
	var b = 1;
	function getRealNum(){
		 var virNum = document.getElementById("virNum");
		var realNum = document.getElementById("realNum");
		 
		 var virNum1 = document.getElementById("virNum1")
		var realNum1 = document.getElementById("realNum1");
		 
		 var virNum2= document.getElementById("virNum1").innerHTML;
		 if(virNum2 == "" || virNum2 == null  || virNum2 == undefined) {
			 var nogood = $("#nogood").text();
				if(virNum.innerHTML == "" || virNum.innerHTML == null  || virNum.innerHTML == undefined) {
					$("#realNum").text("");
					$("#good").text("");
					
				}else {
					document.getElementById("realNum").innerHTML= a;
					$("#good").text(realNum.innerHTML - nogood);
				}
				if(parseInt(virNum.innerHTML) > parseInt(realNum.innerHTML)) {
					a++;
				}
		 }else {
			 var nogood = $("#nogood").text();
				var nogood1 = $("#nogood1").text();
				document.getElementById("realNum").innerHTML= a;
				document.getElementById("realNum1").innerHTML= b;
				$("#good").text(realNum.innerHTML - nogood);
				$("#good1").text(realNum1.innerHTML - nogood1);
				if(virNum == "" || virNum == null  || virNum == undefined) {
					return;
				}
				if(parseInt(virNum.innerHTML) > parseInt(realNum.innerHTML)) {
					a++;
				}
				if(parseInt(virNum1.innerHTML) > parseInt(realNum1.innerHTML)) {
					b++;
				}
		 }
	}

	//setTimeout(getRealNum(),1000);
</script>
<style type="text/css">
table {
	font-size: 32px;
}

font {
	font-size: 32px;
}
</style>
<style type="text/css">
.mytitile {
	width:100%;
	float:left;
	height:40px;
	background-color: #F7F7F7;
	margin-bottom: 5px;
}

/* font {
	color: black;
	font-size: 30px;
} */

label {
	font-size: 32px;
}
input {
	font-size: 32px;
}

.all{
	width: 1300px;
    height: 580px;
	/* background-color: gray; */
	}
.top{
	width: 100%;
	height: 7%;
	margin-bottom: 1%;
}
.bottom{
	width: 100%;
	height: 90%;
	/* background-color: red; */
}
.bottom_top{
	width: 100%;
	height: 20%;
	margin-bottom: 1%;
	/* background-color: gray; */
}
.bottom_top_Item{
	width: 10%;
	height: 70%;
	background-color: blue;
	margin-right:1%;
	float: left;
}
.bottom_top_Item:hover{
		outline:1px solid red;
	}
.text{
	text-align: center;
	line-height: 650%;
}
.bottom_bottom{
	width: 100%;
	height: 70%;
	/* background-color: gray; */
}
.font{
	color:white;
}
</style>
<script type="text/javascript">
	function func(val){
		var parent = val.parentNode;
		var allChild = parent.childNodes;
		for (var int = 1; int < allChild.length; int=int+2) {
			if(allChild[int] != val){
				//console.log(int + "不是当前点击的div");
				$(allChild[int]).css("outline","1px solid #e4eaee");
			}else {
				//console.log(int + "jiu是当前点击的div");
				var $aList = $(val).find("div");
				var font = $aList.find("font");
				var value = font[0].innerHTML;
				$(allChild[int]).css("outline","1px solid red");
			}
		}
	}
	
	/* 获取类型选中项 */
	function func1(){
		var $aList = $(".bottom_top_Item");
		//console.log($aList);
		for (var int = 0; int < $aList.length; int++) {
			//console.log($aList[int].childNodes);
			console.log("第" + int+ "个的style：" + $aList[int].getAttribute("style"));
			if($aList[int].getAttribute("style") != null && $aList[int].getAttribute("style") != "outline: rgb(228, 234, 238) solid 1px;"){
				var value = $aList[int].childNodes[2].previousSibling.innerText;
				return value;
			}
		}
		return null;
	}
	
	//查询设备信息，根据车间信息
	function selectEquipment() {
		var cid = $("#carroom").val();
		$("#deviceId").text("");
	    $.ajax({
	        url:'${pageContext.request.contextPath }/jy/selectEquipment.do',
	        type:"POST",
	        dataType:'json',
	        data:{cid:cid},
	        success:function (result) {
	            for (var i = 0; i < result.length; i++) {
	                $("#deviceId").append("<option value="+result[i].eid+">"+result[i].name+"</option>");
	            }
	        }
	    });
	}
</script>
</head>
<body>
	<table class="table table-bordered" height="700px">
		<tbody align="center">
			<tr>
				<td>车种</td>
				<td colspan="2">
					<select id="carroom" tyle="width: 100%; height: 95%;" onchange="selectEquipment()">
						<option value="">-请选择-</option>
					</select>
				</td>
				<td>设备编号</td>
				<td colspan="2"><select id="deviceId" tyle="width: 100%; height: 95%;"></select></td>
				<!-- <td colspan="2"><select id="deviceId"
					style="width: 100%; height: 95%;"
					onchange="change(this.options[this.options.selectedIndex].value)">
				</select></td> -->
				<td colspan="2" id="nowDate"></td>
			</tr>
			<tr>
				<td>作业者</td>
				<td id="name1"></td>
				<td id="name2"></td>
				<td> <a onclick="pcdxz()" style="color: blue;">排产单选择</a></td>
				<td colspan="3" ></td>
			</tr>
			<!-- <tr>
				<td>车种</td>
				<td id="cartype" colspan="2"></td>
				<td>模具编号</td>
				<td id="modelid" colspan="2"></td>
				<td></td>
			</tr> -->
			<tr class="warning">
				<td>品编</td>
				<td id="number" colspan="2"></td>
				<td>品名</td>
				<td id="pname" colspan="2"></td>
				<td></td>
			</tr>
			
			<tr class="warning">
				<td>计划量</td>
				<td colspan="2" id="virNum"></td>
				<td>实际量</td>
				<td colspan="2" id="realNum"></td>
				<td></td>
			</tr>
			<tr class="warning">
				<td>良品</td>
				<td colspan="2" id="good"></td>
				<td>不良品</td>
				<td colspan="2" id="nogood"></td>
				<td><button id="btn">不良登记</button></td>
			</tr>
			<tr class="danger">
				<td>品编</td>
				<td id="number1" colspan="2"></td>
				<td>品名</td>
				<td id="pname1" colspan="2"></td>
				<td></td>
			</tr>
			<tr class="danger">
				<td>计划量</td>
				<td colspan="2" id="virNum1"></td>
				<td>实际量</td>
				<td colspan="2" id="realNum1"></td>
				<td></td>
			</tr>
			<tr class="danger">
				<td>良品</td>
				<td colspan="2" id="good1"></td>
				<td>不良品</td>
				<td colspan="2" id="nogood1"></td>
				<td><button id="btn1">不良登记</button></td>
			</tr>
		</tbody>
	</table>

	<button id="submitBtn3" type="button" class="btn btn-primary">
		<font>作业开始</font>
	</button>
	<button id="submitBtn4" type="button" class="btn btn-primary"
		class="btn btn-default" >
		<font>员工代码输入</font>
	</button>
	<button id="submitBtn5" type="button" class="btn btn-primary">
		<font>作业结束</font>
	</button>


	<!-- 员工代码设定 -->
	<div class="modal fade " id="myModal1" tabindex="-1" role="dialog"
		aria-labelledby="myModal1">
		<div class="modal-dialog" role="document">
			<div class="modal-content">

				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">员工代码输入</h4>
				</div>

				<div class="modal-body">
					<form id="updateform">

						<div class="form-group">
							<label for="email" class="control-label">员工代码1:</label> <input
								type="text" class="form-control" id="email" name="email">
						</div>
						<div class="form-group">
							<label for="email1" class="control-label">员工代码2:</label> <input
								type="text" class="form-control" id="email1" name="email">
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default" 	data-dismiss="modal">关闭</button>
							<button id="submit" type="button" class="btn btn-primary" data-dismiss="modal">提交</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>

	<!-- 不良品登记-->
	<div class="modal fade " id="myModal2" tabindex="-1" role="dialog"
		aria-labelledby="myModal2">
		<div class="modal-dialog" role="document">
			<div class="modal-content" style="width: 150%;margin-left: -25%;padding-bottom: 15%;padding-left: 30%;padding-top: 10%;">
				<div class="all">
					<div class="bottom">
						<div class="bottom_top">
							<div class="bottom_top_Item" onclick="func(this)">
								<div class="text">
									<font class="font">未成形</font>
								</div>
							</div>
							<div class="bottom_top_Item" onclick="func(this)">
								<div class="text">
									<font class="font">毛边</font>
								</div>
							</div>
							<div class="bottom_top_Item" onclick="func(this)">
								<div class="text">
									<font class="font">冷料</font>
								</div>
							</div>
							<div class="bottom_top_Item" onclick="func(this)">
								<div class="text">
									<font class="font">亮印</font>
								</div>
							</div>
						</div>
						<div class="bottom_bottom">
						<form id="addForm">
								<div id="distinguish" class="form-group">
									<label for="email" class="control-label">区分:</label> <input
										type="radio" name="distinguish" id="in" value="1"> <font>内部</font>
									&nbsp;&nbsp; <input type="radio" name="distinguish" id="out"
										value="2"> <font>外包</font>
								</div>

								<div class="row">
									<div class="col-lg-8">
										<label for="email" class="control-label">登记者:</label>
										<div class="input-group">
											<input id="registrar" name="registrar" type="text"
												style="float: left; background-color: #CFCFCF;"
												readonly="readonly"> <span class="input-group-btn"
												style="float: left;">
											</span>
										</div>
									</div>
								</div>
								<br />
								<div class="row">
									<div class="col-lg-8">
										<div class="form-group">
											<label for="email" class="control-label">不良工程：</label>
											<div class="input-group">
												<input type="text" id="badproject" name="badproject">
											</div>
										</div>
									</div>
								</div>

								<div id="team" class="form-group">
									<label for="email" class="control-label">作业班:</label> <input
										type="radio" name="team" id="day" value="1"> <font>白班
									</font> &nbsp;&nbsp; <input type="radio" name="team" id="night"
										value="2"> <font>晚班</font>
								</div>

								<div class="text-left">
									<span id="returnMessage" class="glyphicon"> </span>
									<button id="submitBtn1" type="button" class="btn btn-primary" data-dismiss="modal"
										style="font-size: 26px">保存</button>
									<button id="rejects2" type="button"
										class="btn btn-default right" data-dismiss="modal"
										style="font-size: 26px">取消</button>
								</div>
								
							</form>
						</div>
					</div>
				</div>

			</div>
		</div>
	</div>
	
		<div class="modal fade" id="addModal" tabindex="-1" role="dialog"
		aria-labelledby="addModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content"  style="width: 1000px;">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close" aria-hidden="true" onclick="resets()">&times;</button>
					<h4 class="modal-title" id="addModalLabel">排产单选择</h4>
				</div>
							<table id="tb_departments"></table>
						<div class="modal-footer">
							<button type="button" class="btn btn-default" data-dismiss="modal" onclick="resets()">关闭</button>
							<button type="submit" class="btn btn-primary"  onclick = "submitpc()">保存</button>
						</div>
			</div>
		</div>
	</div>
	
	<input type="hidden"  id="pcid">
	<input type="hidden"  id="pcid1">
	<input type="hidden"  id="pdid">
	<input type="hidden"  id="pdid1">
</body>
</html>